home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / database / dmsudf / dmsudf.doc next >
Text File  |  1987-08-06  |  15KB  |  426 lines

  1. (c) 1987 D. M. Sampson Consulting
  2.     David M. Sampson, Technical Support
  3.     Data Based Solutions, Inc.
  4.     Publisher of the DATA BASED ADVISOR
  5.  
  6. Documentation for the functions found in the DMS library.  
  7.  
  8. FUNCTION:    APPROX
  9.  
  10. SYNTAX:      APPROX(<expC>,<expN>)
  11.  
  12.              expC = the Character expression you want to look for
  13.              expN = the field number your data base file is indexed on
  14.  
  15. DESCRIPTION: APPROX will first attempt a SEEK to find an exact match.if 
  16.              one  is  found  then it returns with  the  record  pointer 
  17.              looking at the correct record. The same as a straight SEEK
  18.  
  19.              if  the  SEEK is unsuccessful then the  function  returns 
  20.              with the record pointer looking at the record which would 
  21.              have  been the next record down from the  correct  record 
  22.              had it been there.
  23.  
  24.              if  the  search  is  unsuccessful  and  the  record   you 
  25.              attempted to find would have been the last record in  the 
  26.              data base then the function will return you to the top of 
  27.              the file.
  28.  
  29.              Only  Date, Character or Numeric Fields can be used  with 
  30.              this  function, if any other type of field  is  specified 
  31.              you  will get a Run Time Error: ... and the program  will 
  32.              close all databases and abort to the dos prompt.
  33.  
  34.              APPROX  returns  the record number of  the  record  found 
  35.              according  to  the description above. You  may  use  this 
  36.              record number if you would like but it is not necessary.
  37.  
  38.              CAUTION:  RECORD  NUMBER ONE will be confiscated by  this 
  39.                        function  and the information in the key  field 
  40.                        will be deleted.
  41.  
  42.                        The  paragraph  above is NOT referring  to  the 
  43.                        first  record at the top of the file  according 
  44.                        to the index, which you would find by executing 
  45.                        the  command GO TOP, this is the actual  Record 
  46.                        #1,  which  you  would find  by  executing  the 
  47.                        command GOTO 1.
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56. FUNCTION:    FILEHERE
  57.  
  58. SYNTAX:      Filehere( <filename>, <expC1>, <expC2>, <exprC3> )
  59.  
  60.              <filename> = The name of the file you want to search for.
  61.  
  62.              <expC>     = 3 available lines of comments to display if
  63.                           the file is not found.
  64.  
  65.  
  66. DESCRIPTION: The filename must include the file extension.
  67.  
  68.              Each  character  expression can be as long as  you  would 
  69.              like  but  the function will only display  the  first  50 
  70.              characters.  There will be up to 4 lines displayed  if  a 
  71.              file  is  not  found, the first line will  be  a  generic 
  72.              statement indicating the file name which was searched for 
  73.              and  not found.  The 3 you pass will be  displayed  below 
  74.              it.
  75.  
  76.              The  message  will  be displayed in  the  middle  of  the 
  77.              screen,  will  ask  for a single key  input,  then  after 
  78.              hitting a key will disappear returning the screen to what 
  79.              it looked like before the message.
  80.  
  81.              FILEHERE returns a .T. if the file was found and a .F. if 
  82.              it was not found.
  83.  
  84.  
  85.  
  86. FUNCTION:    PRNTON / PRNTOFF
  87.  
  88. SYNTAX:      Prnton() / Prntoff()
  89.  
  90. DESCRIPTION: The  Prntoff Function simply SETs DEVICE TO SCREEN,  SETs 
  91.              PRINT OFF and SETs CONSOLE ON.
  92.  
  93.              The  Prnton  Function  simply  reverses  the  same  three 
  94.              commands.
  95.  
  96.              They both return a .T. simply because I couldn't think of 
  97.              any thing else to return.
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111. FUNCTION:    R2 / R3 / R4
  112.  
  113. SYNTAX:      R2( <exp1>, <exp2N>, <exp3N> )
  114.              R3( <exp1>, <exp2N>, <exp3N>,<exp4N>, <exp5N> )
  115.              R4( <exp1>, <exp2N>, <exp3N>, ... <exp7N> )
  116.  
  117.  
  118.  
  119. DESCRIPTION: The  purpose  of  these functions is  to  permit  Clipper 
  120.              arrays to function as multi dimensinal arrays. The Number 
  121.              that  is a part of the function name indicates  how  many 
  122.              dimensions that functin will similate.
  123.  
  124.              For  the 2 dimensional array the last numeric  expression 
  125.              represents  the  total number of elements  in  the  major 
  126.              axis.
  127.  
  128.              For   the  3  dimensional  array  the  last   2   numeric 
  129.              expressions   represent  the  total  elements   in   each 
  130.              respective axis.
  131.  
  132.              For   the  4  dimensional  array  the  last   3   numeric 
  133.              expressions   represent  the  total  elements   in   each 
  134.              respective axis.
  135.  
  136. EXAMPLE:     Two Dimensional Array:
  137.              store 3  to x,xe    && first level
  138.              store 30 to y,ye    && lowest level
  139.  
  140.              declare arrayname[xe * ye]
  141.  
  142.              ? arrayname[r2(2,25,xe)] displays the value of the
  143.                                       25th position in the 2nd element
  144.  
  145.  
  146.  
  147. EXAMPLE:     Three Dimensional Array:
  148.              store 4  to x,xe
  149.              store 10 to y,ye
  150.              store 8  to z,ze
  151.              declare arrayname[xe * ye * ze]
  152.              ? arrayname[r3(3,9,6,ye,ze)] displays the value in the
  153.                                           6th position of the
  154.                                           9th Y element of the
  155.                                           3rd X element.
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166. FUNCTION:    RJUST
  167.  
  168. SYNTAX:      RJUST( <expN1>, <expN2>, <expC> )
  169.  
  170.              <expN1> = Row you want to display your justified message
  171.              <expN2> = The column at which you want the message to be
  172.                        justified.
  173.              <expC>  = The message you want displayed.
  174.  
  175.  
  176. DESCRIPTION: This function displays any message on the screen right
  177.              justified against the <expN2> column.
  178.  
  179. EXAMPLE:     chr1 = 'This message will be justified'
  180.  
  181.              RJUST(23,60,chr1)  && This will display this:
  182.  
  183.                               This message will be justified
  184.                                                            ^
  185.                                                            |
  186.                                              Column #60 ----
  187.  
  188.              RJUST(23,40,chr1) && will diplay this:
  189.  
  190.  
  191.           This message will be justified
  192.                                        ^
  193.                                        |
  194.                            Column #40 --
  195.  
  196.  
  197. FUNCTION:    CENTER
  198.  
  199. SYNTAX:      CENTER( <expN>, <expC> )
  200.  
  201.              <expN> = The row you want to center your message on
  202.              <expC> = The message you want centered
  203.  
  204. DESCRIPTION: CENTER  takes  the expression in <expC> and  displays  it 
  205.              centered on row <expN>.
  206.  
  207.              Center assumes an 80 column screen. if you don't have  an 
  208.              80 column screen this won't work for you.
  209.  
  210. EXAMPLE:     CENTER(23,chr1) && This will display these on your screen
  211.  
  212.              chr1 = 'This will be centered'
  213.  
  214.                              This will be centered
  215.  
  216.              chr1 = 'This line will also be centered on line 23'
  217.  
  218.                    This line will also be centered on line 23
  219.  
  220.  
  221. FUNCTION:    LOOKUP
  222.  
  223. SYNTAX:      LOOKUP( <expC1>, <expC2>, <expN> )
  224.  
  225. DESCRIPTION: LOOKUP  is  normally attached to a VALID clause to  do  an 
  226.              automatic 'Lookup' after data input in a GET variable.
  227.  
  228.              LOOKUP saves the current work area, moves to the  workarea 
  229.              with the <expC2> alias, does a SEEK on <expC1>.
  230.  
  231.              If the SEEK is successful then the value in  FIELD(<expN>) 
  232.              is displayed 2 columns to the right of the GET variable.
  233.  
  234.              If  the  SEEK is unsuccessful then a window  is  displayed 
  235.              showing all possible choices and the cursor is placed back 
  236.              in the variable waiting for further input.
  237.  
  238.  
  239. EXAMPLE:     Select 0
  240.              use account index code  alias wa_acc
  241.              Select 0
  242.              use transact  alias tran
  243.  
  244.  
  245.              ** The account.dbf has a structure like this:
  246.  
  247.              ACCTCODE   C   4
  248.              ACCTDESC   C  20
  249.  
  250.              @ 23,20 say 'Account Code: ' get acct valid;
  251.  
  252.                                           lookup(acct,'wa_acc',2)
  253.  
  254.              The above source code would move to the WA_ACC work  area, 
  255.              do  a  search  with 'acct' (ie the get  variable)  as  its 
  256.              expression  and if succesful would display  ACCTDESC  (the 
  257.              field data) to the right of the variable ACCT then  return 
  258.              to the TRAN workarea
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276. FUNCTION:    IMPLODE / EXPLODE
  277.  
  278. SYNTAX:      EXPLODE( <top>, <lft>, <bot>, <rit>, <inc> )
  279.  
  280.              <top> = the top most row where the window will endup
  281.              <lft> = the left most column where the window will endup
  282.              <bot> = the bottom most row where the window will endup
  283.              <rit> = the right most column where the window will endup
  284.              <inc> = the number of times you want the window to increment
  285.                      as it is growing to its largest size.
  286.  
  287.  
  288. DESCRIPTION: EXPLODE  starts from the center of the anticipated  window 
  289.              and grows in an 'exploding' fashion until it grows to  its 
  290.              ultimate size.
  291.  
  292.              These  windows  are able to be displayed anywhere  on  the 
  293.              screen.
  294.  
  295.              <inc>  can  not  be  0 or you will get  a  'DIVIDE  BY  0' 
  296.              message.
  297.  
  298.              IMPLODE  does  the  exact opposite. It  starts  where  the 
  299.              window  is  right  now and shrinks it  in  an  'imploding' 
  300.              fashion to the center of the window.
  301.  
  302.              The <inc> value in each do not have to be the same.
  303.  
  304. EXAMPLE:     EXPLODE(05,20,19,40,08)
  305.  
  306.              A window will be 'exploded' into position and end up  with 
  307.              the upper left hand corner at coordinates (row 5, col  20) 
  308.              and  the lower right hand corner at coordinates  (row  29, 
  309.              col 40) and it will 'explode' in 08 increments.
  310.  
  311.  
  312.              IMPLODE(10,01,14,78,05)
  313.  
  314.              A  window  will 'implode' (ie shrink)  starting  from  the 
  315.              upper left hand corner at coordinates (row 10, col 01) and 
  316.              the lower right hand corner being at coordinates (row  14, 
  317.              col 78) and will 'implode' in 05 increments.
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331. FUNCTION:    RESPONSE
  332.  
  333. SYNTAX:      RESPONSE( <expC1>, <expC2>, <expN>, <expC3> )
  334.  
  335.              <expC1> &
  336.              <expC2>  = 2 lines of messages to be displayed
  337.                         they will be displayed on lines 23, 24
  338.              <expN>   = A numeric value for the number of seconds you
  339.                         want the messages to appear.
  340.              <expC3>  = Character string for those keys which are valid
  341.                         responses.
  342.  
  343. DESCREPTION: This function is an enhancement of the dBase WAIT command. 
  344.              <expC1>  and <expC2> will both be centered on rows 23  and 
  345.              24  respectivly. The messages will stay on the screen  for 
  346.              <expN>  real seconds, or until a key is pressed if  <expN> 
  347.              equals 0.
  348.  
  349.              Only  those Characters in <expC3> will return a .T., if  a 
  350.              key  other  than  those which are a  part  of  <expC3>  is 
  351.              pressed this function will return a .F. .
  352.  
  353.              If  you  do not want to specifiy which keys they  have  to 
  354.              press replace <expC3> with the string 'ALL' or 'all' (case 
  355.              is  ignored) and it will return a .T. no matter  what  key 
  356.              they press.
  357.  
  358.              If  <expN> is greater than 0 then <expC3> must be =  'all' 
  359.              or  the message will wait <expN> seconds beep and  display 
  360.              the message again in an endless loop.
  361.  
  362. EXAMPLE:     chr1 = 'Press one of the following keys'
  363.              chr2 = '(A)bort   (R)etry    (I) dont know what to do!!'
  364.  
  365.              do while .not. RESPONSE(chr1,chr2,0,'ari')
  366.                   ?? chr(07)
  367.              enddo
  368.  
  369.              The the following will be displayed on rows 23 & 24:
  370.  
  371.                         Press one of the following keys
  372.                 (A)bort   (R)etry    (I) dont know what to do!!
  373.  
  374.              this  code will beep once if any key other than a, r or  i 
  375.              is pressed then return to the RESPONSE function.
  376.  
  377.              chr1 = 'You have just blown it and if you want to and'
  378.              chr2 = 'don't quit you'll blow it again!!
  379.  
  380.              RESPONSE(chr1,chr2,10,'all')
  381.  
  382.              This code will display the following for 10 real seconds:
  383.  
  384.                  You have just blown it and if you want to and
  385.                        don't quit you'll blow it again!!
  386. FUNCTION:    NDEXDISP
  387.  
  388. SYNTAX:      NDEXDISP( <expN>, <expC> )
  389.  
  390.              <expN> = row you want your message to be displayed
  391.              <expC> = the message you want displayed
  392.  
  393.  
  394. DESCRIPTION: One  of the things wrong with commands like INDEX,  DELETE 
  395.              and REINDEX is that they take over and you have no control 
  396.              over  the diplay or how and when to quit in the middle  of 
  397.              one  of their runs, well, thanks to Nantucket  those  days 
  398.              are  over.  All  you  have to do  is  attach  this  little 
  399.              function onto the index expression as one of the  elements 
  400.              (or  onto one of the DELETE FOR/WHILE conditions) and  you 
  401.              will be able to display all of what you want and even more 
  402.              during  any  of those command processes. This  even  works 
  403.              with many other commands.
  404.  
  405.  
  406. EXAMPLE:     chr1 = 'Indexing Record #'
  407.              index on lastname+frstname+NDEXDISP(24,chr1) to name.ntx
  408.  
  409.              During  the index processing on row #24 you will see  this 
  410.              displayed on your screen.
  411.  
  412.              Indexing Record # <cur_rec#> of <total records>
  413.  
  414.              <cur_rec#> will race through displaying each record number 
  415.              as it progresses.
  416.  
  417.              <total  records> will constantly display the  same  number 
  418.              which will be equivilant to the total records in the  data 
  419.              base.
  420.  
  421.              Each  time  the  index  file  is  accessed  this  will  be 
  422.              displayed, even after the actual indexing is finished.  In 
  423.              other  words  if  you REINDEX, SEEK,  FIND  or  PACK  this 
  424.              message will show up on line #24 (or what ever number  you 
  425.              set)
  426.